package com.guess.study.designpattern.strategy;

/**
 * Created by tianran on 2019-06-24.
 * 封装角色
 */
public class Context {

    /**
     * 抽象策略
     */
    private Strategy strategy;

    /**
     * 构造函数设置具体策略
     *
     * @param strategy
     */
    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    /**
     * 封装后的策略方法
     */
    public void executeStrategy() {
        this.strategy.doSomething();
    }
}
